//===============================================================================
// @ IvIndexedGeometry.h
// 
// Concrete class that implements rendering of an indexed triangle set as a set
// of vertex arrays
// ------------------------------------------------------------------------------
// Copyright (C) 2008-2015 by James M. Van Verth and Lars M. Bishop.
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
//===============================================================================

#ifndef __IvIndexedGeometry__h__
#define __IvIndexedGeometry__h__

//-------------------------------------------------------------------------------
//-- Dependencies ---------------------------------------------------------------
//-------------------------------------------------------------------------------
#include <IvReader.h>
#include <IvWriter.h>

class IvVertexBuffer;
class IvIndexBuffer;
class IvCapsule;

//-------------------------------------------------------------------------------
//-- Typedefs, Structs ----------------------------------------------------------
//-------------------------------------------------------------------------------

//-------------------------------------------------------------------------------
//-- Classes --------------------------------------------------------------------
//-------------------------------------------------------------------------------

class IvIndexedGeometry
{
public:
    // constructor/destructor
    IvIndexedGeometry();
    ~IvIndexedGeometry();

    bool LoadFromStream(IvReader& in, IvCapsule& boundingCapsule);
    void FreeResources();

    void Render();
    
protected:
    // geometry
    IvVertexBuffer* mVertices;
    IvIndexBuffer*  mIndices;

};

//-------------------------------------------------------------------------------
//-- Inlines --------------------------------------------------------------------
//-------------------------------------------------------------------------------

//-------------------------------------------------------------------------------
//-- Externs --------------------------------------------------------------------
//-------------------------------------------------------------------------------

#endif
